﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using leviathan.supervisor;

namespace leviathan_rpg
{
    public partial class Form1 : Form
    {
        public Supervisor Felugyelo;
        Form characterGeneration;
        Form characterLoad;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            navpanel.Visible = false;
            Felugyelo = new Supervisor(textBox1, navpanel);
        }

        private void quitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void newGameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            characterGeneration = new characterGeneration(Felugyelo);
            characterGeneration.Visible = true;
            characterGeneration.Activate();
            characterGeneration.BringToFront();
        }

        private void loadGameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            characterLoad = new characterLoad(Felugyelo);
            characterLoad.Visible = true;
            characterLoad.Activate();
            characterLoad.BringToFront();
        }

        private void saveGameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if(Supervisor.Status.startGame == Felugyelo.getGameState())
                Felugyelo.saveCharacter();
        }

        private void creditsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Balázs Gregorics\n\nTesztelők:\nA,B,C\n\nGRBTAAI\n2013.\nAll rights reserved.", "Készítők");
        }

        private void helpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Help.ShowHelp(this, "../../help/manual.htm");
            Help.ShowHelp(this,"http://code.google.com/p/leviathan-rpg/wiki/User_Manual");
        }

        private void button_navleft_Click(object sender, EventArgs e)
        {
            Felugyelo.chooseLeft();
            Felugyelo.updateScreen();
        }

        private void button_navright_Click(object sender, EventArgs e)
        {
            Felugyelo.chooseRight();
            Felugyelo.updateScreen();
        }

        private void button_navsearch_Click(object sender, EventArgs e)
        {
            Felugyelo.chooseSearch();
            Felugyelo.updateScreen();
        }

        private void button_navfight_Click(object sender, EventArgs e)
        {
            Felugyelo.chooseFight();
            Felugyelo.updateScreen();
        }

        private void kódBeírásaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Supervisor.Status.startGame == Felugyelo.getGameState())
            {
                Form InputBox = new InputBox(Felugyelo);
                InputBox.Activate();
                InputBox.Show();
                InputBox.BringToFront();
            }
        }

        private void karakteredToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Supervisor.Status.startGame == Felugyelo.getGameState())
                textBox1.Text += Felugyelo.getStats();
        }

    }
}
